#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	FILE* pfin = fopen("text1.txt", "r");
	if (pfin == NULL)
	{
		perror("fopen pfout");
		return 1;
	}
	FILE* pfout = fopen("text2.txt", "w");
	if (pfout == NULL)
	{
		perror("fopen pfin");
		fclose(pfin);
		return 1;
	}
	int ch = 0;
	while ((ch=fgetc(pfin)) != EOF)
	{
		fputc(ch, pfout);
	}
	fclose(pfin);
	pfin = NULL;
	fclose(pfout);
	pfout = NULL;
	return 0;
}